<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>操作当当购物车页面</title> 
	<link  href="css/cartStyle.css" rel="stylesheet"/>
	<script>
		function showAll(){
			var ar=document.all;//慢
			alert("本网页总共有"+ar.length);
			for(let o of ar){
				console.log(o);
			}
		}
		function showDoc(){
			alert(window.document.URL);
			alert("title:"+window.document.title);
			alert("最后修改时间:"+window.document.lastModified);
			alert("从哪里来？:"+window.document.referrer);
		}
		function changeTitle(){
			window.document.title=window.prompt("请输入新标题：");
			window.document.body.bgColor="red";
		}
		function findFirstLi(){
			//var d=document.getElementsByTagName("img");
			let p=document.querySelector(".content .logo img");
			p.src="../images/icon.png";
			
			
		}
	</script>
</head>
<body >
<div>
	<button type="button" onclick="showAll()">所有元素</button>
	<button type="button" onclick="showDoc()">文档信息</button>
	<button type="button" onclick="changeTitle()">修改标题</button>
	
	<button type="button" onclick="findFirstLi()">修改第一个span旁边的图片</button>
</div>
<div class="content">
    <div class="logo">
        <img src="images/dd_logo.jpg"><span>关闭</span>
    </div>
    <div class="cartList" id="cartList">
        <ul>
            <li>商品图片</li>
            <li>商品信息</li>
            <li>单价</li>
            <li>数量</li>
            <li>总价</li>
            <li>操作</li>
        </ul>
        <ul>
            <li><img src="images/dog.jpg"></li>
            <li>我和狗狗活下来了</li>
            <li>¥<input type="text" name="price" value="21.90"></li>
            <li><input type="button" name="minus" value="-" onclick=""><input type="text" name="amount" value="1"><input type="button" name="plus" value="+" onclick=""></li>
            <li id="price0">¥21.90</li>
            <li><p  onclick="collection();">移入收藏</p><p>删除</p></li>
        </ul>
        <ul>
            <li><img src="images/mai.jpg"></li>
            <li>灰霾来了怎么办</li>
            <li>¥<input type="text" name="price" value="24.00"></li>
            <li><input type="button" name="minus" value="-" onclick=""><input type="text" name="amount" value="1"><input type="button" name="plus" value="+" onclick=""></li>
            <li id="price1">¥24.00</li>
            <li><p  >移入收藏</p><p>删除</p></li>
        </ul>
        <ol>
            <li id="totalPrice">商品总计：<span></span></li>
            <li><span>结 算</span></li>
        </ol>
    </div>
</div>
</body>
</html>